<?php

namespace App\Models\GameServer;

use Illuminate\Database\Eloquent\Model;

class Order extends Model
{
    protected $table = 'order';
    protected $primaryKey = 'id';
    protected $connection = 'game_server';

    protected $fillable = [
        'order_no', 'gamer_id','goods_id','gamer_name','goods_name','product_no','quantity','goods_price','total','status','expire_time',
        'transid','trans_time','actual_price','paytype','distributer_id','ip','ip_loc'
    ];

    protected $dates = [
        'trans_time','created_at','updated_at'
    ];

    protected $paytype = [
        1 => '充值卡',
        2 => '游戏点卡',
        4 => '银行卡',
        401 => '支付宝',
        402 => '财付通',
        403 => '微信支付',
        5 => '爱贝币',
        6 => '爱贝一键支付',
        16 => '百度钱包',
        30 => '移动话费',
        31 => '联通话费',
        32 => '电信话费',
        8 => '海马币',
        103 => '京东支付',
        108 => '易付宝',
        109 => '易联付',
        110 => '快付宝'
    ];

    public function getPaytypeAttribute($value)
    {
        if ($value) {
            return $this->paytype[$value];
        }

    }
}
